#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>


int main(int argc, char* argv[])
{
    printf("我是一个进程：%d\n", getpid());
    if(argc != 2)
    {
        printf("后面需要更上文件名\n");
        return 2;
    }

    //chdir("/home/yyh");
    FILE* pf = fopen("log.txt", "w");
    if(pf == NULL)
    {
        perror("fopen");
        return 1;
    }
    //const char* str = "hello world\n";
    //fwrite(str, strlen(str), 1, pf);
    //while(1)
    //{
    //    sleep(1);
    //}
    fclose(pf);

    return 0;
}
